
var EShadow = new Class({
    Implements: [Options, Events],
    options: {
        'elementId': null,
        'className': null
    },

    initialize: function(_options) {
        this.setOptions(_options);

        if (this.options.elementId) {
            this.setShadow($(this.options.elementId));
        }

        if (this.options.className) {
            $$('[class=' + this.options.className + ']').each(function(e) {
                //alert(e.getProperty('class'));
                this.setShadow(e);
            }, this);
        }

    },

    setShadow: function(e) {
    
        var c = e.getCoordinates();

        var w = c.width, h = c.height;

        e.setStyles({ 'overflow': 'visible', 'position': 'relative' });

        var tl = new Element('span').inject(e);
        tl.setStyles({
            'width': w + 5,
            'height': h + 5,
            'top': -6,
            'left': -6,
            'background': 'transparent url(./dropshadow-lg.png) repeat-x scroll 0 0',
            'position': 'absolute',
            'background-position': '0 0',
			'z-index': -1
        });

        var tli = new Element('span').inject(tl);
        tli.setStyles({
            'width': 5,
            'height': 6,
            'top': 0,
            'right': -5,
            'background': 'transparent url(./dropshadow-lg.png) repeat-x scroll 0 0',
            'position': 'absolute',
            'background-position': '100% 0',
			'z-index': -1
        });

        var br = new Element('span').inject(e);
        br.setStyles({
            'width': w + 4,
            'height': h + 4,
            'top': 0,
            'left': 0,
            'background': 'transparent url(./dropshadow-lg.png) repeat-x scroll 0 0',
            'position': 'absolute',
            'background-position': '100% 100%',
			'z-index': -1
        });

        var bri = new Element('span').inject(br);
        bri.setStyles({
            'width': 5,
            'height': 6,
            'bottom': -1,
            'left': -5,
            'background': 'transparent url(./dropshadow-lg.png) repeat-x scroll 0 0',
            'position': 'absolute',
            'background-position': '0 100%',
			'z-index': -1
        });
    }

});